home *** CD-ROM | disk | FTP | other *** search
- //----------------------------------------------------------------------------
- //Borland C++Builder
- //Copyright (c) 1987, 1997 Borland International Inc. All Rights Reserved.
- //----------------------------------------------------------------------------
- //---------------------------------------------------------------------------
- #include <vcl\vcl.h>
- #pragma hdrstop
-
- #include "datamod.h"
- #include "errform.h"
- //---------------------------------------------------------------------------
- #pragma resource "*.dfm"
- TCacheData *CacheData;
- //---------------------------------------------------------------------------
- __fastcall TCacheData::TCacheData(TComponent* Owner)
- : TDataModule(Owner)
- {
- }
- //---------------------------------------------------------------------
- // This event is triggered when an error occurs during the update process
- // (such as a key violation). Here we use another form to show the user
- // the error and allow them to decide what to do about it. See ErrForm.cpp
- // for more information
- void __fastcall TCacheData::UpdateErrorHandler(TDataSet *DataSet,
- EDatabaseError *E, TUpdateKind UpdateKind,
- TUpdateAction &UpdateAction)
- {
- UpdateAction = UpdateErrorForm->HandleError(DataSet, E, UpdateKind);
- }
- //---------------------------------------------------------------------
- // This event displays the current update status in a calculated field
- void __fastcall TCacheData::CacheQueryCalcFields(TDataSet *DataSet)
- {
- AnsiString UpdateStatusStr[] = {"Unmodified", "Modified", "Inserted", "Deleted"};
-
- if (CacheQuery->CachedUpdates)
- CacheQueryUpdateStatus->Value = UpdateStatusStr[CacheQuery->UpdateStatus()];
- }
- //---------------------------------------------------------------------
-